<%
  options = {
    default: '',
    size: 340,
  }
  options[:default] = @default if @default.present?
  options[:size] = @size if @size.present?
  query = options.map { |key, value| "#{key}=#{value}" }.join('&')
  url = URI::HTTPS.build(host: "www.gravatar.com", path: "/avatar/#{@md5}", query: query)
  classes = @rounded ? 'rounded-full' : ''
%>
<%= link_to_if @link_to_record.present?, image_tag(url.to_s, class: classes, width: options[:size], height: options[:size]), @link, title: @title %>
